load("@bazel_skylib//lib:selects.bzl", "selects")

config_setting(
    name = "linux_x86_64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:x86_64",
    ],
)

config_setting(
    name = "linux_aarch64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:aarch64",
    ],
)

config_setting(
    name = "linux_ppc64le",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:ppc",
    ],
)

config_setting(
    name = "darwin_x86_64",
    constraint_values = [
        "@platforms//os:osx",
        "@platforms//cpu:x86_64",
    ],
)

config_setting(
    name = "darwin_aarch64",
    constraint_values = [
        "@platforms//os:osx",
        "@platforms//cpu:aarch64",
    ],
)

selects.config_setting_group(
    name = "async_simple_with_uthread",
    match_any = [
        ":linux_x86_64",
        ":linux_aarch64",
        ":linux_ppc64le",
        ":darwin_x86_64",
        ":darwin_aarch64",
    ],
    visibility = ["//visibility:public"],
)

config_setting(
    name = "msvc_compiler",
    flag_values = {
        "@bazel_tools//tools/cpp:compiler": "msvc-cl",
    },
)

selects.config_setting_group(
    name = "async_simple_has_not_aio",
    match_any = [
        "@platforms//os:windows",
        "@platforms//os:macos",
        ":async_simple_disable_aio",
    ],
)

config_setting(
    name = "async_simple_disable_aio",
    define_values = {"ASYNC_SIMPLE_DISABLE_AIO": "true"},
)

config_setting(
    name = "async_simple_enable_ssl",
    define_values = {"ENABLE_SSL": "true"},
    visibility = ["//visibility:public"],
)
